package com.javafive;

import com.javafour.User;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.Reader;

import java.util.stream.Stream;

public class Demo10 {

    public static void main(String[] args) throws Exception {
        String path="E:\\webWork\\javaKh62Demo\\src\\com\\javafive\\txt\\1.txt";
        Reader reader =  new FileReader(path);
        BufferedReader bufferedReader = new BufferedReader(reader);
        //String s = bufferedReader.readLine();

        /*
        *   String line = null;
            StringBuffer sbf=new StringBuffer();
            //循环读取并追加字符
            while ((line = bufferedReader.readLine()) != null) {
                sbf.append(line);
            }
            System.out.println("替换前："+sbf);
        *
        * */

        Stream<String> lines = bufferedReader.lines();
        lines.forEach(x-> System.out.println(x));
    }
}
